import QtQuick 1.1
import com.nokia.meego 1.0

PageStackWindow {
  id: appWindow

  initialPage: SplashPage { id: splashPage }

  AppStateVars {
    id: appState
  }

  WaitIndicator {
    id: waitIndicator
    anchors.centerIn: contentPane
    width: contentPane.width
    height: contentPane.height
    z: 120
  }

  Item {
    id: contentPane

    clip: true
    anchors {
      fill: parent
      margins: 2
    }

    FeedView {
      id: feedView
      anchors {
        top: contentPane.top
        bottom: contentPane.bottom
      }
      width: parent.width
    }

    FeedItemView {
      id: feedItemView
      anchors {
        top: parent.top
        bottom: parent.bottom
      }
      width: parent.width
    }
  }

  states: [
    State {
      name: "showingSplashScreen"
      PropertyChanges {
        target: splashMain
      }
    },
    State {
      name: "showingFeedView"
      when: appState.currentViewName === "feedView"
      PropertyChanges {
        target: appState
        feedItemView: false
      }
    },
    State {
      name: "showingItemFeedView"
      when: appState.currentViewName === "feedItemView"
      PropertyChanges {
        target: appState
        feedItemView: true
      }
    }
  ]
}